package cn.tkxqc.aoptest.controller;


import cn.tkxqc.aoptest.pojo.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Controller
public class UserController {

    @RequestMapping("/list")
    @ResponseBody
    public List<User> getUserList(){

        List<User> list = new ArrayList<>();
        User user = new User("0002","lisi",10);
        User user1 = new User("0003","wangwu",58);

        list.add(user);
        list.add(user1);
        return list;
    }

    @RequestMapping("/test")
    @ResponseBody
    public Map<String,Object> query(@RequestBody Map<String,Object> map){

        map.put("tt","我是说");
        return map;
    }
}
